package com.xjy.headfirst.命令模式;

/**
 * decription:
 *
 * @author 辛纪元
 * @since 2022-07-07
 */

public class RemoteLoader {

    public static void main(String[] args) {
        RemoteControl remoteControl = new RemoteControl();
        CeilingFan ceilingFan = new CeilingFan("Living Room");
        CeilingFanHighCommand ceilingFanHighCommand = new CeilingFanHighCommand(ceilingFan);
        CeilingFanMediumCommand ceilingFanMediumCommand = new CeilingFanMediumCommand(ceilingFan);
        CeilingFanOffComman ceilingFanOffComman = new CeilingFanOffComman(ceilingFan);
        remoteControl.setCommand(0, ceilingFanHighCommand, ceilingFanOffComman);
        remoteControl.setCommand(1, ceilingFanMediumCommand, ceilingFanOffComman);
        remoteControl.onButtonWasPushed(0);
        remoteControl.offButtonWasPushed(0);
        remoteControl.undoCommand();
        remoteControl.onButtonWasPushed(1);
        remoteControl.undoCommand();

    }

//    public static void main(String[] args) {
//        Light liveingRoomLight = new Light("Living Room");
//        Light kitchenLigh = new Light("kitchen");
//
//        Stereo stereo = new Stereo("Living Room");
//
//        LightOnCommand lightOnCommand = new LightOnCommand(liveingRoomLight);
//        LightOffCommand lightOffCommand = new LightOffCommand(liveingRoomLight);
//
//        LightOnCommand kitchenOnCommand = new LightOnCommand(kitchenLigh);
//        LightOffCommand kitchenOffCommand = new LightOffCommand(kitchenLigh);
//
//        StereoOnWithCDCommand stereoOnWithCDCommand = new StereoOnWithCDCommand(stereo);
//        StereoOffWithCDCommand stereoOffWithCDCommand = new StereoOffWithCDCommand(stereo);
//
//        RemoteControl remoteControl = new RemoteControl();
//        remoteControl.setCommand(0,lightOnCommand,lightOffCommand);
//
//        remoteControl.setCommand(1,kitchenOnCommand,kitchenOffCommand);
//
//        remoteControl.setCommand(2,stereoOnWithCDCommand,stereoOffWithCDCommand);
//
//        System.out.println(remoteControl);
//
//        remoteControl.onButtonWasPushed(0);
//        remoteControl.offButtonWasPushed(0);
//        remoteControl.onButtonWasPushed(1);
//        remoteControl.offButtonWasPushed(1);
//        remoteControl.onButtonWasPushed(2);
//        remoteControl.offButtonWasPushed(2);
//        remoteControl.undoCommand();
//        System.out.println(remoteControl);
//    }
}
